/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufscar.compiladores.ast;

/**
 *
 * @author takeshi
 */

public class BooleanExpr extends Expr {
    
    public static BooleanExpr True = new BooleanExpr(true);
    public static BooleanExpr False = new BooleanExpr(false);
    private boolean value;
    
    public BooleanExpr(boolean value) {
        this.value = value;
    }

    public void genC(PW pw, boolean putParenthesis) {
        pw.out.print(value ? "1" : "0");
    }

    public Type getType() {
        return Type.booleanType;
    }
    
}